<?php

/**
 * Celebrity form base class.
 *
 * @method Celebrity getObject() Returns the current form's model object
 *
 * @package    iEasy
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseCelebrityForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'celebrity_id'      => new sfWidgetFormInputHidden(),
      'name'              => new sfWidgetFormInputText(),
      'create_time'       => new sfWidgetFormDateTime(),
      'modify_time'       => new sfWidgetFormDateTime(),
      'snapshot_big'      => new sfWidgetFormTextarea(),
      'snapshot_small'    => new sfWidgetFormTextarea(),
      'hit_i'             => new sfWidgetFormInputText(),
      'hit_mask_i'        => new sfWidgetFormInputText(),
      'status_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Status'), 'add_empty' => true)),
      'tag'               => new sfWidgetFormTextarea(),
      'source'            => new sfWidgetFormTextarea(),
      'catalog_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog'), 'add_empty' => true)),
      'keyword'           => new sfWidgetFormTextarea(),
      'member_level_i'    => new sfWidgetFormInputText(),
      'content_type_i'    => new sfWidgetFormInputText(),
      'company_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Company'), 'add_empty' => true)),
      'office_site_links' => new sfWidgetFormTextarea(),
      'english_name'      => new sfWidgetFormInputText(),
      'sex'               => new sfWidgetFormInputText(),
      'career'            => new sfWidgetFormInputText(),
      'country'           => new sfWidgetFormTextarea(),
      'location'          => new sfWidgetFormTextarea(),
      'birthday'          => new sfWidgetFormInputText(),
      'horoscope'         => new sfWidgetFormInputText(),
      'height'            => new sfWidgetFormInputText(),
      'weight'            => new sfWidgetFormInputText(),
      'blood_type'        => new sfWidgetFormInputText(),
      'school'            => new sfWidgetFormTextarea(),
      'brief'             => new sfWidgetFormTextarea(),
      'celebrity_type'    => new sfWidgetFormInputText(),
      'is_audit_b'        => new sfWidgetFormInputText(),
      'daily_hit'         => new sfWidgetFormInputText(),
      'weekly_hit'        => new sfWidgetFormInputText(),
      'monthly_hit'       => new sfWidgetFormInputText(),
      'capital_letter'    => new sfWidgetFormInputText(),
      'work_date'         => new sfWidgetFormInputText(),
      'system_user_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'add_empty' => true)),
      'is_recommend_b'    => new sfWidgetFormInputText(),
      'is_on_top_b'       => new sfWidgetFormInputText(),
      'publish_time'      => new sfWidgetFormDateTime(),
      'member_num_i'      => new sfWidgetFormInputText(),
      'company_name'      => new sfWidgetFormTextarea(),
      'c_type'            => new sfWidgetFormInputText(),
      'band_name'         => new sfWidgetFormInputText(),
      'band_member'       => new sfWidgetFormTextarea(),
      'band_color'        => new sfWidgetFormInputText(),
      'band_slogan'       => new sfWidgetFormTextarea(),
      'mascot'            => new sfWidgetFormInputText(),
      'fans_name'         => new sfWidgetFormInputText(),
      'stage_name'        => new sfWidgetFormInputText(),
      'foreign_name'      => new sfWidgetFormInputText(),
      'friends'           => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'celebrity_id'      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('celebrity_id')), 'empty_value' => $this->getObject()->get('celebrity_id'), 'required' => false)),
      'name'              => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'create_time'       => new sfValidatorDateTime(array('required' => false)),
      'modify_time'       => new sfValidatorDateTime(array('required' => false)),
      'snapshot_big'      => new sfValidatorString(array('required' => false)),
      'snapshot_small'    => new sfValidatorString(array('required' => false)),
      'hit_i'             => new sfValidatorInteger(array('required' => false)),
      'hit_mask_i'        => new sfValidatorInteger(array('required' => false)),
      'status_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Status'), 'required' => false)),
      'tag'               => new sfValidatorString(array('required' => false)),
      'source'            => new sfValidatorString(array('required' => false)),
      'catalog_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog'), 'required' => false)),
      'keyword'           => new sfValidatorString(array('required' => false)),
      'member_level_i'    => new sfValidatorInteger(array('required' => false)),
      'content_type_i'    => new sfValidatorInteger(array('required' => false)),
      'company_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Company'), 'required' => false)),
      'office_site_links' => new sfValidatorString(array('required' => false)),
      'english_name'      => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'sex'               => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'career'            => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'country'           => new sfValidatorString(array('required' => false)),
      'location'          => new sfValidatorString(array('required' => false)),
      'birthday'          => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'horoscope'         => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'height'            => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'weight'            => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'blood_type'        => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'school'            => new sfValidatorString(array('required' => false)),
      'brief'             => new sfValidatorString(array('required' => false)),
      'celebrity_type'    => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'is_audit_b'        => new sfValidatorInteger(array('required' => false)),
      'daily_hit'         => new sfValidatorInteger(array('required' => false)),
      'weekly_hit'        => new sfValidatorInteger(array('required' => false)),
      'monthly_hit'       => new sfValidatorInteger(array('required' => false)),
      'capital_letter'    => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'work_date'         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'system_user_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'required' => false)),
      'is_recommend_b'    => new sfValidatorInteger(array('required' => false)),
      'is_on_top_b'       => new sfValidatorInteger(array('required' => false)),
      'publish_time'      => new sfValidatorDateTime(array('required' => false)),
      'member_num_i'      => new sfValidatorInteger(array('required' => false)),
      'company_name'      => new sfValidatorString(array('required' => false)),
      'c_type'            => new sfValidatorInteger(array('required' => false)),
      'band_name'         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'band_member'       => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'band_color'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'band_slogan'       => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'mascot'            => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'fans_name'         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'stage_name'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'foreign_name'      => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'friends'           => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('celebrity[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Celebrity';
  }

}
